<template>
	<view class="article">
		<view class="article-list">
			<view class="article-list-view" v-for="(item,index) in list" @click="urlClick('/pages/bak/details?id='+item.id)">
				<image :src="item.img"></image>
				<view class="article-list-view-r">
					<view class="article-list-view-r-title"> {{item.name}}</view>				
					<view class="article-list-view-r-cennt">
						{{item.brief}}
					</view>
					<view class="article-list-view-r-date">{{item.issue_time}}</view>
				</view>
			</view>
			
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				page :1 ,
				limit : 10 ,
				list :[],
				count : 0,
			}
		},
		onLoad() {
			this.getall();
		},
		onReachBottom(){
			
			if(this.count  == this.limit){
				this.page += 1;
				this.getall();
			}
			
			console.log(222);
		},
		onPullDownRefresh() {
			this.page = 1;
			this.list= [];
			setTimeout(()=>{
				this.getall();
				uni.stopPullDownRefresh();
			},1000)
		},
		methods: {
			getall(){
				let that  = this;
				that.$bak.getBak({'where':'is_type = 0','page':that.page,'limit':that.limit}).then(res=>{
					that.list = [...that.list,...res.data.list];
					that.count= res.data.count;
				})
			},
			urlClick(e){
				uni.navigateTo({
					url:e
				})
			}
		}
	}
</script>

<style lang="less">
	@import url('../../common/css/article.less');
	.article-list-view-r-cennt {
		
		height: 70rpx !important;
	}
	
</style>
